package com.gaoyubo.service;

import com.gaoyubo.entity.User;
import com.gaoyubo.mapper.UserMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public void zhuce(User user) {
        userMapper.zhuce(user);
    }

    @Override
    public User logToList(User un) {
        return userMapper.logToList(un);
    }

    @Override
    public PageInfo<User> list(Integer pageNum, Integer pageSize, User u) {
        PageHelper.startPage(pageNum,pageSize);
        List<User> ulist= userMapper.list(u);
        return new PageInfo<>(ulist);
    }
}
